{extend name='base'/}
{block name='content'}
<!--右侧主题部分 start-->
<div class="col-xs-12 col-sm-9 col-lg-10">
    <ol class="breadcrumb" style="background-color: #f9f9f9;padding:8px 0;margin-bottom:10px;">
        <li>
            <a href=""><i class="fa fa-cogs"></i>
                栏目管理</a>
        </li>
        <li class="active">
            <a href="">栏目列表</a>
        </li>
    </ol>
    <ul class="nav nav-tabs" role="tablist">
        <li class="active"><a href="{:url('index')}">栏目列表</a></li>
        <li><a href="{:url('store')}">添加栏目</a></li>
    </ul>
    <form action="" method="post">
        <div class="panel panel-default">
            <div class="panel-body">
                <table class="table table-hover">
                    <thead>

                    <tr>
                        <th width="80">编号</th>
                        <th>栏目名称</th>
                        <th width="200">操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    {foreach name='field' key='key' item='vo'}
                    <tr>
                        <td>{$vo['cate_id']}</td>
                        <td>{$vo['_cate_name']}</td>
                        <td>
                            <div class="btn-group">
                                <button data-toggle="dropdown" class="btn btn-primary btn-xs dropdown-toggle">操作 <span class="caret"></span></button>
                                <ul class="dropdown-menu dropdown-menu-right">
                                    <li><a href="{:url('addson',['cate_id'=>$vo['cate_id']])}">添加子类</a></li>
                                    <li><a href="">编辑</a></li>
                                    <li class="divider"></li>
                                    <li><a href="{:url('delete',['cate_id'=>$vo['cate_id']])}">删除</a></li>


                                </ul>
                            </div>
                        </td>
                    </tr>
                    {if (!empty($vo['child'])) }
                    {volist name="$vo['child']" id="ve"}
                    <tr>
                        <td>{$ve['cate_id']}</td>
                        <td>  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;----{$ve['cate_name']}</td>
                        <td>
                            <div class="btn-group">
                                <button data-toggle="dropdown" class="btn btn-primary btn-xs dropdown-toggle">操作 <span class="caret"></span></button>
                                <ul class="dropdown-menu dropdown-menu-right">
                                    <li><a href="{:url('addson',['cate_id'=>$ve['cate_id']])}">添加子类</a></li>
                                    <li><a href="">编辑</a></li>
                                    <li class="divider"></li>
                                    <li><a href="{:url('delete',['cate_id'=>$ve['cate_id']])}">删除</a></li>


                                </ul>
                            </div>
                        </td>
                    </tr>
                    {/volist}
                    {/if}

                    {/foreach}

                    </tbody>
                </table>
            </div>
        </div>
    </form>
    <div class="pagination pagination-sm pull-right">

    </div>

    <div>

        <script type="text/javascript">
            $(function(){
                $('.tree li:has(ul)').addClass('parent_li').find(' > span').attr('title', 'Collapse this branch');
                $('.tree li.parent_li > span').on('click', function (e) {
                    var children = $(this).parent('li.parent_li').find(' > ul > li');
                    if (children.is(":visible")) {
                        children.hide('fast');
                        $(this).attr('title', 'Expand this branch').find(' > i').addClass('icon-plus-sign').removeClass('icon-minus-sign');
                    } else {
                        children.show('fast');
                        $(this).attr('title', 'Collapse this branch').find(' > i').addClass('icon-minus-sign').removeClass('icon-plus-sign');
                    }
                    e.stopPropagation();
                });
            });
        </script>
        <!--
        <div class="tree well">

            {volist name="$field" id="vo"}
            <ul>
                <li>
                    <span><i class="icon-folder-open"></i> {$vo['cate_name']}</span>
                    <ul>
                        {if (!empty($vo['child'])) }
                            {volist name="$vo['child']" id="ve"}
                            <li>
                                <span><i class="icon-minus-sign"></i> {$ve['cate_name']}</span> <a href=""></a>
                            </li>
                            {/volist}
                        {/if}

                    </ul>
                </li>

            </ul>
            {/volist}
        </div>-->

    </div>
</div>
<!--右侧主题部分 end-->

{/block}